def utc2lt(udate, utime):
	import datetime
	y = int('20' + udate[4:])
	dt = datetime.datetime(y, int(udate[2:4]), int(udate[0:2]),
							int(utime[0:2]), int(utime[2:4]), int(utime[4:6]))
	import time
	utcs = time.mktime(dt.timetuple())
	tt = time.localtime(utcs + 28800)
	ldate = str(tt[2]).zfill(2) + str(tt[1]).zfill(2) + str(tt[0])[2:]
	ltime = str(tt[3]).zfill(2) + str(tt[4]).zfill(2) + str(tt[5]).zfill(2) + utime[6:]
	return [ldate, ltime]

if __name__ == '__main__':
	import sys
	import string
	srcfn = sys.argv[1]
	desfn = srcfn[0: (len(srcfn)-4)] + '_lt.txt'
	sf = open(srcfn)
	df = file(desfn, "w")
	try:
		for line in sf:
			lst_line = line.split(',')
			lt = utc2lt(lst_line[9], lst_line[1])
			lst_line[1] = lt[1]
			lst_line[9] = lt[0]
			lst_line[7] = str(float(lst_line[7])*1.85)
			lst_line[11] = lst_line[11][0:3]
			print >> df, string.join(lst_line, ',')
	finally:
		sf.close()
		df.close()
